emacs: fix an auto-save permissions race condition
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 29 Dec 2011 20:44:31 +0000 (12:44 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 29 Dec 2011 20:44:31 +0000 (12:44 -0800)
commiteaeee710902059b6d5fa32e03a1c4241ea448784
treeffaed7d167e50492f07f01768f8cfde318d34b65
parent5a0f296cde8a34f0ad90a3479c375e8ac011c04a
emacs: fix an auto-save permissions race condition

* fileio.c (auto_saving_dir_umask): New static var.
(Fmake_directory_internal): Use it.
(do_auto_save_make_dir): Set it, instead of invoking chmod after
creating the directory.  The old code temporarily assigns
too-generous permissions to the directory.
(do_auto_save_eh): Clear it.
(Fdo_auto_save): Catch all errrors, not just file errors, so
that the var is always cleared.
src/ChangeLog
src/fileio.c